home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
c1tutor.exe
/
READLINE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1987-07-04
|
442b
|
20 lines
/* Chapter 10 - Program 6 */
#include "stdio.h"
main()
{
FILE *fp1;
char oneword[100];
char *c;
fp1 = fopen("TENLINES.TXT","r");
do {
c = fgets(oneword,100,fp1); /* get one line from the file */
if (c != NULL)
printf("%s",oneword); /* display it on the monitor */
} while (c != NULL); /* repeat until NULL */
fclose(fp1);
}